from django.conf.urls.defaults import *
from django.conf import settings
from django.conf.urls.static import static


urlpatterns = patterns('brispon.views',
    url(r'^$', 'index', name='index'),
    url(r'^contract/$', 'contract', name='contract'),
    url(r'^user/$', 'user_info', name='user_info'),
    url(r'^lookup/$', 'lookup', name='lookup'),

    url(r'^m/$', 'mindex', name='mindex'),
    url(r'^m/user/$', 'muser_info', name='muser_info'),
    url(r'^m/contract/$', 'mcontract', name='mcontract'),

) + patterns('brispon.views.coupon',
    url(r'^coupon/$', 'list', name='coupons'),
#    url(r'^coupon/increase/$', 'inc_list', name='inc_coupon'),
    url(r'^coupon/id/(?P<coupon_id>\w+)/$', 'detail', name='coupon'),
    url(r'^coupon/sms/(?P<coupon_id>\w+)/(?P<user_id>\w+)/$', 'send_sms', name='send_coupon_by_sms'),

    url(r'^m/coupon/$', 'mlist', name='mcoupons'),

) + patterns('brispon.views.store',
    url(r'^store/$', 'list', name='stores'),
    url(r'^store/test/$', 'list_test', name='stores_test'),
    url(r'^map/$', 'stores_map', name='stores_map'),
#    url(r'^store/id/(?P<store_id>\w+)/$', 'detail', name='store_datail'),
    url(r'^store/increase/$', 'inc_list', name='inc_store'),
    url(r'^store/(?P<name>.*)$', 'detail', name='store_datail'),

    url(r'^m/store/$', 'mlist', name='mstores'),
#    url(r'^m/store/id/(?P<store_id>\w+)/$', 'mdetail', name='mstore'),
    url(r'^m/store/test/$', 'mlist_test', name='mstores_test'),
    url(r'^m/store/(?P<name>.*)$', 'mdetail', name='mstore'),
    url(r'^m/map/$', 'mstores_map', name='mstores_map'),

) + patterns('brispon.views.category',
    url(r'^category/$', 'list', name='category'),
    url(r'^category/id/(?P<category_id>\w+)/$', 'detail', name='category_detail'),
    
    url(r'^m/category/$', 'mlist', name='mcategory'),

) + patterns('brispon.views.event',
    url(r'^event/$', 'list', name='events'),
    url(r'^event/test/$', 'list_test', name='events_test'),
    url(r'^event/id/(?P<event_id>\w+)/$', 'detail', name='event_detail'),
    url(r'^event/increase/$', 'inc_list', name='inc_event'),
    url(r'^event/main/increase/$', 'inc_main_list', name='inc_main_list'),
    url(r'^event/check_active/$', 'check_active', name='check_active'),
#    url(r'^event/(?P<name>.*)$', 'detail', name='event_detail'),
    
    url(r'^m/event/$', 'mlist', name='mevents'),
    url(r'^m/event/test$', 'mlist_test', name='mevents_test'),
    url(r'^m/event/id/(?P<event_id>\w+)/$', 'mdetail', name='mevent'),
    url(r'^m/event/increase/$', 'minc_list', name='minc_event'),
    url(r'^m/event/coupon/(?P<event_id>\w+)/$', 'mcoupon', name='mcoupon'),
    url(r'^m/event/kakao$', 'mkakao', name='mkakao'),
#    url(r'^m/event/(?P<name>.*)$', 'mdetail', name='mevent')

)+ patterns('brispon.views.recruit',
    url(r'^recruit/$', 'list', name='recruits'),

    url(r'^m/recruit/$', 'mlist', name='mrecruits'),
    url(r'^m/recruit/id/(?P<recruit_id>\w+)/$', 'mdetail', name='mrecruit_detail'),
)

if settings.DEBUG is False:   #if DEBUG is True it will be served automatically
    urlpatterns += patterns('',
            url(r'^static/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.STATIC_ROOT}),
    )
